package cn.luischen.aspect;

import java.util.Arrays;
import javax.servlet.http.HttpServletRequest;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import cn.luischen.service.log.LogService;

import static org.junit.Assert.*;
import static org.mockito.ArgumentMatchers.*;
import static org.mockito.Mockito.*;
import org.junit.Rule;
import org.junit.runner.RunWith;
import org.junit.rules.ExpectedException;
import org.junit.Test;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.powermock.modules.junit4.PowerMockRunner;
import org.powermock.reflect.Whitebox;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import org.mockito.stubbing.Answer;
import java.lang.reflect.Method;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.TypeReference;
import com.alibaba.fastjson.parser.ParserConfig;
import java.util.Map;
import java.util.List;
import com.unitspirit.runtime.*;

/**
 * The class contains tests for the class cn.luischen.aspect.WebLogAspect.
 *
 * @generatedBy UnitSpirit CreateTemplateTestFile4
 * @version 1.0.9.11 
 */
@PowerMockIgnore({ "javax.management.*" })
public class WebLogAspect_doBefore_WGTest {
	@Rule
	public ExpectedException unitspirit_thrown = ExpectedException.none();

	/**
	 * 测试方法初始化.
	 * 
	 * @throws Exception 
	 *         if the initialization fails for some reason 
	 *  
	 * @generatedBy UnitSpirit at 2021-12-06 21:50:23
	 */
	@org.junit.Before
	public void setUp() throws Exception {
		try {
			GlobalUnitInit.init();
			MockitoAnnotations.initMocks(this);
			ParserConfig.getGlobalInstance().setAutoTypeSupport(true);
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}

	@InjectMocks
	cn.luischen.aspect.WebLogAspect unitspirit_fixture;

	@Mock
	cn.luischen.service.log.LogService mock_LogService;

	/**
	 * @date 2021-12-06 21:50:24
	 * @see cn.luischen.aspect.WebLogAspect#doBefore
	 * @category null  
	 * @author null  
	 */
	@Test
	public void test_doBefore_20211109_110223_933_1_01() throws Throwable {
		//被测函数参数定义
		org.aspectj.lang.JoinPoint JoinPoint_p_0 = Mockito
				.mock(org.aspectj.lang.JoinPoint.class);
		//成员变量设置

		ThreadLocal<Long> m_un_startTime = new ThreadLocal<>();
		m_un_startTime.set(1L);
		Whitebox.setInternalState(unitspirit_fixture, "startTime",
				m_un_startTime);
		ThreadLocal<Long[]> m_un_startTime3 = new ThreadLocal<>();
		m_un_startTime3.set(new Long[] { 1L, 2L });
		Whitebox.setInternalState(unitspirit_fixture, "startTime3",
				m_un_startTime3);
		//返回值定义 
		//该函数无返回值 

		unitspirit_fixture.doBefore(JoinPoint_p_0);
		assertTrue(true);
	}

}
